class Good < ApplicationRecord
    belongs_to :user, class_name: "User", foreign_key: 'user_id'
    has_many :comments, dependent: :destroy

    has_attached_file :picture, styles: { medium: "500x500>", thumb: "100x100>" }, default_url: "good_default.png"
    validates_attachment_content_type :picture, content_type: /\Aimage\/.*\z/
end
